﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="EditArt.aspx.cs" Inherits="MusicSite.Views.Content.Artist.EditArt" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Create/Edit artist
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server">
    <h2>Create/Edit artist</h2>
    
    <fieldset>
        <legend>Fields</legend>
        <table class="regform">
            <tr>
                <td>
                    <asp:Label ID="label1" runat="server" AssociatedControlID="artistName" Text="Name:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="artistName" runat="server" ></asp:TextBox>
                    <asp:RequiredFieldValidator ID="validatorName" runat="server"
                        ControlToValidate="artistName" ErrorMessage="You must provide an artist name!"
                        InitialValue=""></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label2" runat="server" AssociatedControlID="description" Text="Description:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="description" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="validatorDescription" runat="server"
                        ControlToValidate="description" ErrorMessage="You must provide a description!"
                        InitialValue=""></asp:RequiredFieldValidator>        
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label5" runat="server" AssociatedControlID="" Text="Foudation date:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="foundationDate" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator runat="server" ID="validatorDate" ControlToValidate="foundationDate" 
                        ErrorMessage="You must provide a foundation date!" InitialValue="">
				    </asp:RequiredFieldValidator>
				    <%--<asp:RangeValidator runat="server" ID="validatorDate2" ControlToValidate="foundationDate" 
				        MinimumValue="01-01-1900" MaximumValue="31-12-2009" Type="Date" 
				        ErrorMessage="Please enter a valid date!">
    			    </asp:RangeValidator>--%>
    			    <asp:CustomValidator ID="customValidator" runat="server" ControlToValidate="foundationDate"
    			        OnServerValidate="DateValidate" ErrorMessage="Please enter a valid date!" Display="Dynamic">
    			    </asp:CustomValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label3" runat="server" AssociatedControlID="photo" Text="Photo:"></asp:Label>
                </td>
                <td>
                    <asp:Image ID="photo" runat="server" CssClass="photo"/>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label4" runat="server" AssociatedControlID="fileUpload" Text="Photo URL:"></asp:Label>
                </td>
                <td>
                    <asp:FileUpload ID="fileUpload" runat="server"/>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:LinkButton ID="btnUpdate" runat="server" Text="Update" 
                        OnCommand="UpdateArtist"></asp:LinkButton>
                </td>
                <td>
                    <asp:LinkButton ID="btnDelete" runat="server" Text="Delete" 
                        OnCommand="DeleteArtist"></asp:LinkButton>
                </td>
            </tr>
        </table> 
               
    </fieldset>
    <div>
        <asp:HyperLink ID="hyperLink" runat="server" Text="Back to list" 
            NavigateUrl="~/Views/Content/Artist/IndexArt.aspx" ></asp:HyperLink>    
           
    </div>
</form>
</asp:Content>
